import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)
//路由懒加载
const home = res => {
  require(['@/components/HelloWorld'], res)
};
const search = res => {
  require(['@/components/search'], res);
}
const music = res => {
  require(['@/pages/music'], res);
}
const JJ = res => {
  require(['@/pages/JJ'], res);
}

const signin = res => {
  require(['@/pages/sign_in'], res);
}
const msignin = res => {
  require(['@/pages/m_sign_in'], res);
}
const albumMusicList = res => {
  require(['@/components/album_music_list'], res);
}
const routes = [
  // {
  //   path: '/',
  //   name: 'home',
  //   component: home
  // }
  {
    path: '/search',
    component: search
  },
  {
    path: '/music/:id',
    component: music
  },
  {
    path: '/jj',
    component: JJ
  }, {
    path: '/signin',
    component: signin
  }, {
    path: '/msignin',
    component: msignin
  }, {
    path: '/album/:id',
    component: albumMusicList
  }
];
export default new Router({routes})
